package com.zhiqianbao.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.zhiqianbao.R;
import com.zhiqianbao.entity.Repay;

/**
 * Created by liang on 2016/1/15.
 */
public class RepayOfflineSelectActivity extends BaseActivity implements View.OnClickListener {
    /**
     * 使用绑定的银行卡
     */
    Button useBindBank;
    /**
     * 银行转账付款
     */
    Button useOther;
    Button useTest;

    Repay repay;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_repay_offline_select);
        Intent intent = getIntent();
        repay = (Repay) intent.getSerializableExtra("repay");
        init();
        initView();
    }

    private void initView () {
         useBindBank=(Button)findViewById(R.id.use_bind_bank);
        Button useOther=(Button)findViewById(R.id.use_other);
        Button useTest=(Button)findViewById(R.id.use_test);

        useBindBank.setOnClickListener(this);
        useOther.setOnClickListener(this);
//        useZfb.setOnClickListener(this);
        useTest.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(R.id.use_bind_bank==v.getId()) {
                Intent useBindBankIntent = new Intent(this, UseBindBankCardActivity.class);
                useBindBankIntent.putExtra("repay", repay);
                startActivity(useBindBankIntent);
        }
        else if(R.id.use_other==v.getId()) {
            //银行转账汇款
                Intent offlineBankIntent = new Intent(this, OfflineBankInfoActivity.class);
                offlineBankIntent.putExtra("repay", repay);
                startActivity(offlineBankIntent);
        }
        else if(R.id.use_zfb==v.getId()) {
            //支付宝汇款
//                Intent offlineZfbIntent = new Intent(this, OfflineZfbInfoActivity.class);
//                offlineZfbIntent.putExtra("repay", repay);
//                startActivity(offlineZfbIntent);
        }
        else if(R.id.use_test==v.getId()){
            //测试方法
                Intent zfbIntent = new Intent(this, ZfbConfirmActivity.class);
                zfbIntent.putExtra("repay", repay);
                startActivity(zfbIntent);
        }
    }
}
